home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0151.ZIP / IFSWITCH.ASM < prev    next >
Assembly Source File  |  1985-02-07  |  714b  |  46 lines

  1. title "If Switch" MSDOS Batch Utility
  2. name ifsw
  3. ;
  4. ;Syntax is:
  5. ;
  6. ;ifswitch <1,2>
  7. ;if errorlevel 1 goto ...
  8. ;
  9. ;tests for the specified switch being up. If 3
  10. ;is specified, it means if either switch is up.
  11. ;
  12. code segment
  13. assume cs:code,ds:code
  14.  
  15.     org    005ch
  16.  
  17. tfcb label byte
  18.  
  19.     org    0100h
  20.  
  21. main:    mov    ax,0e000h    ;MC85 segment,
  22.     mov    es,ax
  23.     mov    bx,0f801h    ;BITS location,
  24.     mov    al,es:[bx]    ;sample BITS,
  25.     
  26.     mov    bl,tfcb + 1    ;get 1,2 parm,
  27.     and    bx,0003h    ;strip it,
  28.     mov    ah,cs:bittbl[bx];make test patt
  29.     and    al,ah        ;and with bits
  30.     jz    m1
  31.     mov    al,1
  32. m1:    mov    ah,76
  33.     int    21h        ;terminate
  34. ;
  35. ;bits are backwards in the MC85
  36. ;
  37. bittbl label byte
  38.     db    00
  39.     db    02
  40.     db    01
  41.     db    03
  42.  
  43. code ends
  44.  
  45.     end    main
  46.